/*
package com.sxpi.zixun.valid;

import com.sxpi.zixun.valid.annotation.PasswordMatches;
import com.sxpi.zixun.vo.AdminUserRegVo;
import org.apache.commons.lang3.StringUtils;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

*/
/**
 * @Author: 董伟豪
 * @Date: 2022/8/25 14:14
 * 校验注解实现
 *//*

public class PasswordMatchesValidator implements ConstraintValidator<PasswordMatches, AdminUserRegVo> {

    @Override
    public void initialize(final PasswordMatches constraintAnnotation) { }

    @Override
    public boolean isValid(final AdminUserRegVo adminUserRegVo, final ConstraintValidatorContext context) {
        if(adminUserRegVo == null){
            return true;
        }

        if(StringUtils.isEmpty(adminUserRegVo.getPassword())){
            return true;
        }

        if(StringUtils.isEmpty(adminUserRegVo.getConfirmPassword())){
            return true;
        }

        boolean equals = adminUserRegVo.getPassword().equals(adminUserRegVo.getConfirmPassword());
        return equals;
    }
}
*/
